package com.chezai.client.bean;

import com.chezai.client.dao.ClassRecordDao;
import com.chezai.client.dao.DaoSession;
import com.chezai.client.dao.RandomPhotoDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToOne;

/**
 * Created by likunyang on 2017/11/14.
 */
@Entity
public class RandomPhoto {
    @Id(autoincrement = true)
    private Long _ID;
    private String photoPath;
    private long classRecordId;
    private String _0305;
    /**
     * Const.UPLOAD_SUCESS,Const.UPLOAD_FAILE
     */
    private int uploadStatus;
    /**
     * 重传次数
     */
    private int tryCount;
    private Long takePhotoTimeStamp;
    private String isEndSupplementPhoto;
    @ToOne(joinProperty = "classRecordId")
    private ClassRecord classRecord;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 646756625)
    private transient RandomPhotoDao myDao;
    @Generated(hash = 1585548144)
    public RandomPhoto(Long _ID, String photoPath, long classRecordId, String _0305,
            int uploadStatus, int tryCount, Long takePhotoTimeStamp,
            String isEndSupplementPhoto) {
        this._ID = _ID;
        this.photoPath = photoPath;
        this.classRecordId = classRecordId;
        this._0305 = _0305;
        this.uploadStatus = uploadStatus;
        this.tryCount = tryCount;
        this.takePhotoTimeStamp = takePhotoTimeStamp;
        this.isEndSupplementPhoto = isEndSupplementPhoto;
    }
    @Generated(hash = 2104603901)
    public RandomPhoto() {
    }
    public Long get_ID() {
        return this._ID;
    }
    public void set_ID(Long _ID) {
        this._ID = _ID;
    }
    public String getPhotoPath() {
        return this.photoPath;
    }
    public void setPhotoPath(String photoPath) {
        this.photoPath = photoPath;
    }
    public long getClassRecordId() {
        return this.classRecordId;
    }
    public void setClassRecordId(long classRecordId) {
        this.classRecordId = classRecordId;
    }
    public String get_0305() {
        return this._0305;
    }
    public void set_0305(String _0305) {
        this._0305 = _0305;
    }
    public int getUploadStatus() {
        return this.uploadStatus;
    }
    public void setUploadStatus(int uploadStatus) {
        this.uploadStatus = uploadStatus;
    }
    public int getTryCount() {
        return this.tryCount;
    }
    public void setTryCount(int tryCount) {
        this.tryCount = tryCount;
    }
    public Long getTakePhotoTimeStamp() {
        return this.takePhotoTimeStamp;
    }
    public void setTakePhotoTimeStamp(Long takePhotoTimeStamp) {
        this.takePhotoTimeStamp = takePhotoTimeStamp;
    }
    public String getIsEndSupplementPhoto() {
        return this.isEndSupplementPhoto;
    }
    public void setIsEndSupplementPhoto(String isEndSupplementPhoto) {
        this.isEndSupplementPhoto = isEndSupplementPhoto;
    }
    @Generated(hash = 1994963714)
    private transient Long classRecord__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1393016505)
    public ClassRecord getClassRecord() {
        long __key = this.classRecordId;
        if (classRecord__resolvedKey == null
                || !classRecord__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ClassRecordDao targetDao = daoSession.getClassRecordDao();
            ClassRecord classRecordNew = targetDao.load(__key);
            synchronized (this) {
                classRecord = classRecordNew;
                classRecord__resolvedKey = __key;
            }
        }
        return classRecord;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 723843930)
    public void setClassRecord(@NotNull ClassRecord classRecord) {
        if (classRecord == null) {
            throw new DaoException(
                    "To-one property 'classRecordId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.classRecord = classRecord;
            classRecordId = classRecord.get_ID();
            classRecord__resolvedKey = classRecordId;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 2096253058)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getRandomPhotoDao() : null;
    }
   

}
